#include <cstdio>

int main( )
{
    int i, j, fac[ 4 ] = { 2, 3, 5, 7 }, fn[ 4 ], pos[ 4 ] = { 0, 0, 0, 0 }, f[ 5842 ], minn, n;
    f[ 0 ] = 1;
    for ( i = 1; i < 5842; i++ )
    {
        minn = 0x7fffffff;
        for ( j = 0; j < 4; j++ )
        {
            fn[ j ] = fac[ j ] * f[ pos[ j ] ];
            if ( minn > fn[ j ] )
                minn = fn[ j ];
        }
        for ( j = 0; j < 4; j++ )
            if ( fn[ j ] == minn )
                pos[ j ]++;
        f[ i ] = minn;
    }
    while ( scanf("%d", &n) && n )
    {
        printf("The %d", n);
        i = n % 10;
        if ( !( n >=10 && ( n / 10 ) % 10 == 1 ) )
        {
            switch( i )
            {
                case 1: printf("st"); break;
                case 2: printf("nd"); break;
                case 3: printf("rd"); break;
                default: printf("th"); break;
            }
        }
        else
            printf("th");
        printf(" humble number is %d.\n", f[ n - 1 ]);
    }
    return 0;
}
